#!/usr/bin/env python
#-*- coding:utf-8 -*-

import pygtk
pygtk.require('2.0')
import gtk
import thread
import gobject
import time

class TweakLauncher:
    def __init__(self):
        thread.start_new_thread(self.show_splash, ())
        from MyWindow import window
        wins=window()
    def show_splash(self):
        gtk.gdk.threads_enter()
        win = gtk.Window(gtk.WINDOW_POPUP)
        win.set_position(gtk.WIN_POS_CENTER)
        vbox = gtk.VBox(False, 0)
        image = gtk.Image()
        image.set_from_file('1.jpg')
        vbox.pack_start(image)
        win.add(vbox)
        win.show_all()
        while gtk.events_pending():
            gtk.main_iteration()
        time.sleep(2) 
        win.destroy()
        gtk.gdk.threads_leave()
    def main(self):
        gtk.main()

if __name__ == "__main__":
    try:
        gobject.threads_init()
        launcher = TweakLauncher()
        launcher.main()
    except:
        pass
